﻿using BCCommon;
using BCCommon.OAEnums.WorkflowActive;
using BCDto.OA.WorkflowActive.WorkflowActive;
using BCDto.OA.WorkflowActive.WorkflowActivity;
using BCDto.OA.WorkflowActive.WorkflowActivityOperation;
using BCDto.OA.WorkflowActive.WorkflowActivityStep;
using BCDto.OA.WorkflowActive.WorkflowActivityStepFormConfig;
using BCDto.OA.WorkflowTemplate.WorkflowTemplateStepButtonConfig;
using BCDto.Sim.Admin.Admin;
using BCDto.Website.User;
using System;
using System.Collections.Generic;

namespace BCService.OA.WorkflowActivity
{
    /// <summary>
    /// 工作流活动
    /// </summary>
    public interface IWorkflowActivityService
    {
        /// <summary>
        /// 初始化工作流活动
        /// </summary>
        /// <param name="workflowTemplateId">工作流模板Id</param>
        /// <param name="adminDto">员工信息</param>
        /// <param name="userDto">其他用户信息</param>
        /// <returns></returns>
        WorkflowActivityDto InitActivity(long workflowTemplateId, AdminDto adminDto,UserDto userDto);
        /// <summary>
        /// 提交工作流活动表单
        /// </summary>
        /// <param name="requestDtos">工作流活动步骤表单列表</param>
        /// <param name="adminDto">员工信息</param>
        /// <param name="userDto">其他用户信息</param>
        /// <returns></returns>
        List<WorkflowActivityStepFormConfigDto> SubmitForm(List<WorkflowActivityStepFormConfigRequestDto> requestDtos,AdminDto adminDto,UserDto userDto);
        /// <summary>
        /// 工作流活动步骤执行操作
        /// </summary>
        /// <param name="workflowActivityOperationRequestDto">工作流活动步骤执行操作</param>
        /// <returns></returns>
        WorkflowActivityDto Execution(WorkflowActivityOperationRequestDto workflowActivityOperationRequestDto);
        /// <summary>
        /// 更新工作流活动步骤状态为已激活
        /// </summary>
        /// <param name="putDto">工作流活动步骤信息</param>
        /// <param name="adminDto">人员信息</param>
        /// <param name="userDto">用户信息</param>
        WorkflowActivityStepDto UpdateStepStatusToActivity(WorkflowActivityStepPutDto putDto, AdminDto adminDto, UserDto userDto);
        /// <summary>
        /// 更新工作流活动步骤状态为已完成
        /// </summary>
        /// <param name="putDto">工作流活动步骤信息</param>
        WorkflowActivityStepDto UpdateStepStatusToComplete(WorkflowActivityStepPutDto putDto);
        /// <summary>
        /// 修改工作流活动步骤按钮显示条件
        /// </summary>
        /// <param name="putDto">工作流活动步骤按钮显示条件信息</param>
        /// <returns></returns>
        WorkflowActivityStepDto UpdateStepButtonShowCondition(WorkflowActivityStepButtonConditionPutDto putDto);
        /// <summary>
        /// 获取工作流活动信息
        /// </summary>
        /// <param name="workflowActivityId">工作流活动Id</param>
        /// <returns></returns>
        WorkflowActivityDto Get(long workflowActivityId);
        /// <summary>
        /// 获取工作流活动步骤列表
        /// </summary>
        /// <param name="workflowActivityId">工作流活动Id</param>
        /// <returns></returns>
        IEnumerable<WorkflowActivityStepFormConfigDto> GetActivityStepFormConfigList(long workflowActivityId);
        /// <summary>
        /// 获取工作流活动步骤按钮列表
        /// </summary>
        /// <param name="templateStepCode">工作流模板步骤Code</param>
        /// <returns></returns>
        IEnumerable<WorkflowTemplateStepButtonConfigDto> GetActivityStepButtonList(string templateStepCode);
        /// <summary>
        /// 获取工作流活动步骤列表
        /// </summary>
        /// <param name="workflowActivityId">工作流活动Id</param>
        /// <returns></returns>
        IEnumerable<WorkflowActivityStepDto> GetActivityStepList(long workflowActivityId);
        /// <summary>
        /// 获取工作流活动分页列表(待处理任务)
        /// </summary>
        /// <param name="adminDto">员工信息</param>
        /// <param name="start">开始时间</param>
        /// <param name="end">结束时间</param>
        /// <param name="sortName">排序字段</param>
        /// <param name="ascending">升序</param>
        /// <param name="pageIndex">当前页码</param>
        /// <param name="pageSize">工作流模板每页数据条数</param>
        /// <returns></returns>
        PageableList<WorkflowActivityViewDto> PendingHandleTaskQuery(AdminDto adminDto, DateTime? start, DateTime? end, string sortName, bool? ascending, int pageIndex, int pageSize);
        /// <summary>
        /// 获取工作流活动分页列表（我发起的，已完成的，已关闭的）
        /// </summary>
        /// <param name="adminDto">员工信息</param>
        /// <param name="userDto">其他用户信息</param>
        /// <param name="activityStatus">工作流活动状态</param>
        /// <param name="start">开始时间</param>
        /// <param name="end">结束时间</param>
        /// <param name="sortName">排序字段</param>
        /// <param name="ascending">升序</param>
        /// <param name="pageIndex">当前页码</param>
        /// <param name="pageSize">工作流模板每页数据条数</param>
        /// <returns></returns>
        PageableList<WorkflowActivityDto> Query(AdminDto adminDto, UserDto userDto, OAActivityStatus activityStatus, DateTime? start, DateTime? end, string sortName, bool? ascending, int pageIndex, int pageSize);
    }
}
